#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <queue>
#define ll long long
using namespace std;

const ll mod = 2005060711;
int n, hs[205][205], mi[805], d1[205], d2[205], b[205], nxt[205], tot, ans;
struct dian {
  int x, y;
} t[205];
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int cross(dian p1, dian p2, dian p0) {  // 计算几何基础知识
  return 1ll * (p1.x - p0.x) * (p2.y - p0.y) <
         1ll * (p2.x - p0.x) * (p1.y - p0.y);
}
int abss(int s) { return s < 0 ? -s : s; }
int dis(int a, int b) {
  if (t[a].x == t[b].x) return abss(t[a].y - t[b].y);
  return abss(t[a].x - t[b].x);
}
int ask(int x) {
  int s = lower_bound(b + 1, b + 1 + tot, x) - b;
  int a = 0;
  while (s) s /= 10;
  return a;
}
int main() {
  n = read();
  mi[0] = 1;
  for (int i = 1; i <= 800; i++) mi[i] = 13ll * mi[i - 1] % mod;
  for (int i = 1; i <= n; i++) {
    int x = read(), y = read();
    t[i] = (dian){x, y};
  }
  t[n + 1] = t[1];
  for (int i = 2; i <= n; i++) b[++tot] = dis(i, i - 1);  // 离散化距离，用于hash
  sort(b + 1, b + tot);
  tot = unique(b + 1, b + n) - b - 1;
  // d1----顺时针到1的距离；d2----逆时针
  for (int i = 2; i <= n; i++) d2[i] = d2[i - 1] + dis(i, i - 1);
  for (int i = n; i >= 2; i--) d1[i] = d1[i + 1] + dis(i, i + 1);
  // nxt:0----向左转,1----向右转；nxt----这个点的转角
  for (int i = 2; i <= n; i++) nxt[i] = cross(t[i], t[i + 1], t[i - 1]);
  for (int i = 2; i <= n; i++) {
    for (int j = i + 1; j <= n + 1; j++) {
      ll x = dis(j - 1, j) * 13ll % mod +
             nxt[j];  // 将(j-1)=>(j)的距离和j的角度拼在一起
      x = (x >= mod) ? x - mod : x;
      hs[i][j] = (hs[i][j - 1] * mi[ask(dis(j - 1, j)) + 1] % mod + x) % mod;
      // hs[]为hash数组，注意此处未将初始位置i的转角度数进行存储
    }
  }
  for (int i = 2; i <= n; i++) {
    if (d1[i] <= d2[i])
      continue;  // 若i的较短路方向即为顺时针，则一定不会产生多余路程
    for (int j = i + 1; j <= n + 1; j++) {
      int s = 0;
      for (int k = 2; k <= n; k++)
        if (nxt[k] == nxt[i] && hs[k][j - i + k] == hs[i][j]) s++;
      // 判断是否为'k的前缀'，注意还有初始位置的转角
      if (s == 1) {
        ans = max(ans, d1[i] - d1[j] + min(d2[j], d1[j]) - d2[i]);
        break;
      }
    }
  }
  cout << ans;
  return 0;
}
